
/**
 * @brief    Defines a topology design region for topology optimization.
 *
 * @version  0.1
 * @author   wuxingchuang
 * @date     2025.04.11
 *          _
 *      ___| |__   ___ _ __   __ _  ___  _ __   __ _
 *     / __| '_ \ / _ \ '_ \ / _` |/ _ \| '_ \ / _` |
 *     \__ \ | | |  __/ | | | (_| | (_) | | | | (_| |
 *     |___/_| |_|\___|_| |_|\__, |\___/|_| |_|\__, |
 *                           |___/             |___/
 * @copyright (c) 2024 by 神工仿真, All Rights Reserved.
 */
#pragma once
#include "DataStructure/Common/Id.h"
#include "DataStructure/Common/Real.h"
#include "DataStructure/Input/Design/DesignBase.h"

SG_DATASTRUCTURE_FEM_NAMESPACE_OPEN

struct TOPVARData : public DesignBase {
  struct CASTData {
    SG::DataStructure::Common::Id m_CID2 = 0;    ///<
    SG::DataStructure::Common::I64 m_DDI = 0;    ///<
    SG::DataStructure::Common::I64 m_DIE = 0;    ///<
    SG::DataStructure::Common::I64 m_ALIGN = 0;  ///<
  };
  struct EXTRUSIONData {
    SG::DataStructure::Common::Id m_CID3 = 0;     ///<
    SG::DataStructure::Common::I64 m_EDI = 0;     ///<
    SG::DataStructure::Common::I64 m_ALIGN2 = 0;  ///<
  };
  struct MINData {
    SG::DataStructure::Common::Real m_TDMIN = 0.0;  ///<
    SG::DataStructure::Common::Real m_TDMAX = 0.0;  ///<
  };
  struct PRINTData {
    SG::DataStructure::Common::Id m_CID = 0;  ///< Reference Coordinate System
    SG::DataStructure::Common::I64 m_PRINTD = 0;  ///< Print Direction
    SG::DataStructure::Common::I64 m_ALIGN =
        0;  ///< Aligned Mesh: 1=YES or 0=NO
    SG::DataStructure::Common::Real m_OHANGLE =
        0.0;  ///< overhang critical angle, default=45.0
    SG::DataStructure::Common::I64 m_OHPMETHOD =
        0;  ///< method for ovherhange constraints, default 2 AM Filter,
            ///< 1-pentaly, 0-Ipopt
    SG::DataStructure::Common::Real m_DENCUT =
        0.0;  ///< density modification fact default=0.3
  };
  struct STRESSData {
    SG::DataStructure::Common::Real m_STLIM = 0.0;  ///<
    SG::DataStructure::Common::Real m_PNORM = 0.0;  ///<
    SG::DataStructure::Common::Real m_PSFT = 0.0;   ///<
    SG::DataStructure::Common::I64 m_PMETHOD = 0;   ///<
    SG::DataStructure::Common::I64 m_PMATCH = 0;    ///<
  };
  struct SYMPLANEData {
    SG::DataStructure::Common::Id m_CID = 0;    ///<
    SG::DataStructure::Common::I64 m_MS1 = 0;   ///<
    SG::DataStructure::Common::I64 m_MS2 = 0;   ///<
    SG::DataStructure::Common::I64 m_MS3 = 0;   ///<
    SG::DataStructure::Common::I64 m_CSM = 0;   ///<
    SG::DataStructure::Common::I64 m_NCSM = 0;  ///<
  };

  char m_LABEL[8] = {0};                          ///<
  char m_PTYPE[8] = {0};                          ///<
  SG::DataStructure::Common::Real m_XINIT = 0.0;  ///<
  SG::DataStructure::Common::Real m_XLB = 0.0;    ///<
  SG::DataStructure::Common::Real m_DELXV = 0.0;  ///<
  SG::DataStructure::Common::Real m_POWER = 0.0;  ///<
  SG::DataStructure::Common::Id m_pId = 0;        ///<
  SG::DataStructure::Common::Id m_domainId = 0;   ///<

  std::vector<CASTData> m_CASTList;
  std::vector<EXTRUSIONData> m_EXTRUSIONList;
  std::vector<MINData> m_MINList;
  std::vector<PRINTData> m_PRINTList;
  std::vector<STRESSData> m_STRESSList;
  std::vector<SYMPLANEData> m_SYMPLANEList;
};

///@{ @brief operator override
DECLSPEC bool operator==(const TOPVARData::CASTData& val1,
                         const TOPVARData::CASTData& val2);
DECLSPEC bool operator==(const TOPVARData::EXTRUSIONData& val1,
                         const TOPVARData::EXTRUSIONData& val2);
DECLSPEC bool operator==(const TOPVARData::MINData& val1,
                         const TOPVARData::MINData& val2);
DECLSPEC bool operator==(const TOPVARData::PRINTData& val1,
                         const TOPVARData::PRINTData& val2);
DECLSPEC bool operator==(const TOPVARData::STRESSData& val1,
                         const TOPVARData::STRESSData& val2);
DECLSPEC bool operator==(const TOPVARData::SYMPLANEData& val1,
                         const TOPVARData::SYMPLANEData& val2);

DECLSPEC bool operator==(const TOPVARData& val1, const TOPVARData& val2);
///}@
SG_DATASTRUCTURE_FEM_NAMESPACE_CLOSE
